import httpUtils from "@/core/utils/http.utils";
// service path
const urls = {
    'getSysUserPage': `/api/upms/sysUser/page`,
    'getSysUserById': `/api/upms/sysUser/`,
    'saveSysUser': `/api/upms/sysUser`,
    'updateSysUserById': `/api/upms/sysUser`,
    'deleteSysUserById': `/api/upms/sysUser/`,
    'getSysRoleList': `/api/upms/sysRole/list`,
    'getSysOrgTree': `/api/upms/sysOrg/tree`,
};
// service methods
const sysUserApi = {
    getSysUserPage (param) {
        return httpUtils.get(urls.getSysUserPage, param);
    },
    getSysUserById(id) {
        return httpUtils.get(urls.getSysUserById + id, {});
    },
    saveSysUser(param) {
        return httpUtils.postRequest(urls.saveSysUser, param);
    },
    updateSysUserById(params) {
        return httpUtils.put(urls.updateSysUserById, params);
    },
    deleteSysUser(id) {
        return httpUtils.delete(urls.deleteSysUserById + id);
    },
    getSysRoleList () {
        return httpUtils.get(urls.getSysRoleList, {});
    },
    getSysOrgTree () {
        return httpUtils.get(urls.getSysOrgTree);
    },
};

export default sysUserApi;
